/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_Hotel", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbHotel.findAll", query = "SELECT t FROM TbHotel t"),
    @NamedQuery(name = "TbHotel.findByHID", query = "SELECT t FROM TbHotel t WHERE t.hID = :hID"),
    @NamedQuery(name = "TbHotel.findByHName", query = "SELECT t FROM TbHotel t WHERE t.hName = :hName"),
    @NamedQuery(name = "TbHotel.findByHPrice", query = "SELECT t FROM TbHotel t WHERE t.hPrice = :hPrice")})
public class TbHotel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "h_ID", nullable = false)
    private Integer hID;
    @Column(name = "h_Name", length = 50)
    private String hName;
    @Column(name = "h_price", precision = 53)
    private Double hPrice;
    @Lob
    @Column(name = "h_Description", length = 2147483647)
    private String hDescription;
    @JoinColumn(name = "l_ID", referencedColumnName = "l_ID")
    @ManyToOne
    private TbLocal lid;

    public TbHotel() {
    }

    public TbHotel(Integer hID) {
        this.hID = hID;
    }

    public Integer getHID() {
        return hID;
    }

    public void setHID(Integer hID) {
        this.hID = hID;
    }

    public String getHName() {
        return hName;
    }

    public void setHName(String hName) {
        this.hName = hName;
    }

    public Double getHPrice() {
        return hPrice;
    }

    public void setHPrice(Double hPrice) {
        this.hPrice = hPrice;
    }

    public String getHDescription() {
        return hDescription;
    }

    public void setHDescription(String hDescription) {
        this.hDescription = hDescription;
    }

    public TbLocal getLid() {
        return lid;
    }

    public void setLid(TbLocal lid) {
        this.lid = lid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hID != null ? hID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbHotel)) {
            return false;
        }
        TbHotel other = (TbHotel) object;
        if ((this.hID == null && other.hID != null) || (this.hID != null && !this.hID.equals(other.hID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbHotel[hID=" + hID + "]";
    }

}
